#include "../menu.h"
#include "../../user.h"
#include "filenav.h"

typedef struct Dev_DRAWINFO
{
	DRAWINFO DevIcon;
	DRAWINFO DevName;
}_DEV_DRAWINFO_;

typedef void (*DevFunc) (unsigned char DevNameId);
struct DEV_ITEM
{
	_DEV_DRAWINFO_ DevDrawInfo;
	char DevName[20];
	char DevPointName[20];
	char DevLable[10];
	unsigned char DevId;
	unsigned char DevValid;
	unsigned char DevNameId;
	DevFunc Proc;
};

struct DEV_NODE
{
	struct DEV_ITEM DevItem;
	struct DEV_NODE *Next;
	struct DEV_NODE *Pre;
};

struct DEV_LIST
{
	struct DEV_NODE *Head;
	struct DEV_NODE *End;	
	unsigned int count;
};

struct DEV_CURSOR_NODE
{
	unsigned char CursorId;
	struct DEV_NODE *Node;
};

typedef struct DEV_ITEM _DEV_ITEM_;
typedef struct DEV_NODE _DEV_NODE_;
typedef struct DEV_LIST _DEV_LIST_;
typedef struct DEV_CURSOR_NODE _DEV_CURSOR_NODE_;
extern _DEV_NODE_ NodeSetup;
extern _DEV_LIST_ DevList;
extern _DEV_ITEM_ DevItem;
extern _DEV_NODE_ *pLeftHeadDevNode;
extern _DEV_NODE_ *pCurrentCursorNode;
extern unsigned char DevMountNum;
extern unsigned char CurrentCursor;

void InitialDevList(_DEV_LIST_ *pDevList);
void GetAddDevNodeItem(_DEV_ITEM_ *DevItem, DEV_MOUNT_INFO* devmountmsg, unsigned char DevMountNum);
unsigned char AddDevNode(_DEV_ITEM_ DevItem, _DEV_LIST_ *pDevList);
unsigned char RemoveDevNode(DEV_MOUNT_INFO* devmountmsg, _DEV_LIST_ *pDevList, unsigned char DevMountNum);
void DevicePro(unsigned char DevNameId);
void RefreshDevWindow(PHWND hwnd, unsigned char CursorNum, unsigned char flag);
unsigned char IsNetWorkDev(void);

INT32S WinDeviceSelectInfoOnKeyPress(PHWND hwnd, INT32S lpParam);
INT32S WinDeviceSelectInfoOnShow(PHWND hwnd, INT32S lpParam);
INT32S WinDeviceSelectOnShow(PHWND hwnd, INT32S lpParam);
INT32U GIVE_VOLUME_ICON(unsigned char number,unsigned char selcet);
extern void AWFillRectTxt(COORD x, COORD y, COORD width, COORD height);

#ifdef ENABLE_NETWORK
#define STORAGE_ICON_UPNP        	6
#define STORAGE_ICON_YAHOO      	7
#define STORAGE_ICON_GOOGLE    	8
#define STORAGE_ICON_FRAMECHANNEL       9   
#define STORAGE_ICON_SETUP      	10
#ifdef BROWSER_SUPPORT
#define STORAGE_ICON_BROWSER   11
#endif
#ifdef RSS_GALLERY_SUPPORT
#define STORAGE_ICON_RSSGALLERY 12
#endif
#else
#define STORAGE_ICON_SETUP      6
#define STORAGE_ICON_CALENDAR   7
#endif


#define STORAGE_ICON_SD         0
#define STORAGE_ICON_MS         1
#define STORAGE_ICON_CF         2
#define STORAGE_ICON_XD         3
#define STORAGE_ICON_NAND       4
#define STORAGE_ICON_USB        5

#define ADD_ICON_NUMBER   0
